package com.dq.Week3.day15.customex;

/**
 * 自定义异常类
 * 需要继承父类：一般选择 Exception 或者 RuntimeException
 *
 * 自定义异常可以扩展任何属性
 */
public class UserException extends RuntimeException{

    private Integer exCode; // 异常的编号，例如 user-ex-001

    private String exDesc; // 异常的描述信息： 用户名长度错误


    public Integer getExCode() {
        return exCode;
    }

    public void setExCode(Integer exCode) {
        this.exCode = exCode;
    }

    public String getExDesc() {
        return exDesc;
    }

    public void setExDesc(String exDesc) {
        this.exDesc = exDesc;
    }

    public UserException(String message) {
        super(message);
    }

    public UserException(Integer exCode,String exDesc,String message) {
        super(message);
        this.exCode = exCode;
        this.exDesc = exDesc;
    }


}